package com.qf.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package com.qf.listener
 * @Description:
 * @Date 2022/7/4 20:42
 */
//监听队列的名字
@RabbitListener(queues = "testQueue2")
//将这个类注册到Spring中,作为一个javabean
@Component
public class Listener2 {

    @RabbitHandler
    public void messageHandler(String str){
        System.out.println("=====监听器2====="+str);
    }
}
